package cn.topevery.garden.wapi.controller;

import cn.topevery.garden.dal.logic.EvaluationLogic;
import cn.topevery.garden.entity.query.EvaluationQuery;
import hw.topevery.framework.db.entity.DataPager;
import hw.topevery.framework.web.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@Api("考评统计")
@RestController
@RequestMapping("/evaluationStatistic")
public class EvaluationStatisticsController extends BaseController {
    @Autowired
    private EvaluationLogic evaluationlogic;

    @ApiOperation("统计各企业得分情况")
    @PostMapping("/getStatisticList")
    public JsonResult<DataPager<Map<String, Object>>> getStatisticList(@RequestBody EvaluationQuery query) {
        return JsonResult.ok(evaluationlogic.getStatisticList(query));
    }

    @ApiOperation(("查询单个企业某一类型考评扣分记录"))
    @PostMapping("/getCompanyEvaluation")
    public JsonResult<?> getCompanyEvaluation(@RequestBody EvaluationQuery query) {
        return evaluationlogic.getCompanyEvaluation(query);
    }

}
